package com.citicpub_cloud.restfull.dao;

import java.util.List;

import org.springframework.stereotype.Service;

import com.citicpub_cloud.restfull.dao.core.TbAudioResInfo;
import com.citicpub_cloud.restfull.dao.jdbc.AbstractJdbcDaoSupport;
import com.citicpub_cloud.restfull.dao.mapper.TbAudioResInfoMapper;

@Service
public class AudioResDaoService  extends AbstractJdbcDaoSupport {
	public TbAudioResInfo getBaseInfo(Long id) {
		TbAudioResInfo obj = null;
		try {
			String sql = "select audio_name,audio_url,audio_img,url_size from tb_audio_res where id=" + id;
			
			List<TbAudioResInfo> list = jdbcTemplate.query(sql,new TbAudioResInfoMapper());
			if(list.size()>0){
				obj = list.get(0);
			}
		} catch (Exception e) {
			log.error("根据好书快听或者阅读时差id查找基本信息出错", e);
		}
		
		return obj;
	}
}
